package cn.com.cifi.mars.web.action;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import cn.com.cifi.mars.common.bean.R;
import cn.com.cifi.mars.common.constants.VersionConstant;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;

@Api(tags = "DemoAPI")
@RequestMapping("/${spring.data.rest.base-path}/{apiVersion}/demo")
public interface IDemo {

	@ApiOperation(value = "获取当前用户")
	@GetMapping(value = "currentUser")
	R<String> currentUser(
			@ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion);

	@ApiOperation(value = "loginTmp")
	@GetMapping(value = "loginTmp")
	R<String> loginTmp(
			@ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
			@ApiParam(value = "用户ID（管理员）", required = true, defaultValue = "000038124") @RequestParam(name = "userId") String userId,
			@ApiParam(value = "用户密码（管理员）", required = true,defaultValue = "cifi@2020") @RequestParam(name = "password", required = true) String password);

	@ApiOperation(value = "健康监测接口", notes = "健康监测接口")
	@GetMapping(value = "getRedis")
	public R<String> getRedis(
			@ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
			@ApiParam(value = "值", required = true) @RequestParam(value = "value", defaultValue = "value") String value);

	@ApiOperation(value = "删除redisKey", notes = "删除redisKey")
	@GetMapping(value = "refreshCache")
	public R<String> refreshCache(
			@ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
			@ApiParam(value = "key", required = true) @RequestParam(value = "key", defaultValue = "") String key);

}